#include<bits/stdc++.h>
using namespace std;
int n,a[100005],b[100005];
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	int mx=0;
	vector<int> v;
	for(int i=1;i<=n;i++){
		int x;
		cin>>x;
		mx=max(mx,x);
		a[x]++;
		b[x]++;
	}
	for(int i=1;i<=mx;i++){
		if(a[i]!=0){
			v.push_back(i);
			//cout<<i<<" "<<a[i]<<"\n";
		}
	}
	int len=v.size(),cnt=0;
	int i=0,j=1;
	while(i<len&&j<len){
		if(j<=i){
			j++;
			continue;
		}
		if(a[v[i]]<=b[v[j]]){
			cnt+=a[v[i]];
			b[v[j]]-=a[v[i]];
			i++;
		}else{
			cnt+=b[v[j]];
			a[v[i]]-=b[v[j]];
			j++;
		}
	}
	cout<<n-cnt;
	return 0;
}
